<style lang="scss">
  @import 'index';
</style>

<template>
  <div class="ga-container">
    <div class="ga-addressList">
      <div class="item" v-for="(item,index) in addressList" :key="index">
        <div>
          <p class="p1">
            <span class="mr10">{{item.name}}</span>
            <span class="mr10">{{item.mobile}}</span>
            <!-- <span class="mark">家</span> -->
          </p>
          <p class="p2">{{item.address_tostring}}</p>
        </div>
        <a :href="'/pages/editAddress/main?id='+item.id"><i class="gaIcon edit"></i></a>
      </div>
      

      <div class="ga-bottom-fixed">
        <a href="/pages/editAddress/main" class="bottom">
          新增地址
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {

  data () {
    return {
      addressList: []

    }
  },
  methods: {
    async load () {
      this.$_util.ajax.post('https://guo-a.com/mapi/address/addresslist?token=' + this.$store.state.Token).then((res) => {
        console.log(res)
         if(res.code === 200){
          this.addressList = res.data
         }
      })
    },
    /**
     * 路由跳转
     */
    bindNavigateTo (url) {
        wx.navigateTo({
          url
        })
    },
    bindSwitchTab (url) {
        wx.switchTab({
          url
        })
    }
  },
  mounted () {

  },
  onShow () {
    this.load()
  },
  created () {

  }
}
</script>
